package org.vectrics.recruiter.struts.admin.job;

import java.util.Iterator;

import org.vectrics.common.html.Combo;
import org.vectrics.recruiter.RecruitServiceLocator;
import org.vectrics.recruiter.job.JobFunction;

public class JobFunctionComboBox extends Combo {

	private static final long serialVersionUID = -909523268705021221L;

	public JobFunctionComboBox() {
	
		Iterator iter = RecruitServiceLocator.getJobProvider().findAllJobFunctions().iterator();
		
		if (this.showBlank()) {
			this.addOption("", "");			
		}
		
		while (iter.hasNext()) {
			JobFunction function = (JobFunction)iter.next();
			this.addOption(function.getDescription(), function.getCode());
		}
	}
	
	protected boolean showBlank() {
		return true;
	}
	
}
